   1              		.syntax unified
   2              		.cpu cortex-m3
   3              		.fpu softvfp
   4              		.eabi_attribute 20, 1
   5              		.eabi_attribute 21, 1
   6              		.eabi_attribute 23, 3
   7              		.eabi_attribute 24, 1
   8              		.eabi_attribute 25, 1
   9              		.eabi_attribute 26, 1
  10              		.eabi_attribute 30, 4
  11              		.eabi_attribute 34, 1
  12              		.eabi_attribute 18, 4
  13              		.thumb
  14              		.syntax unified
  15              		.file	"servus.c"
  16              		.text
  17              	.Ltext0:
  18              		.cfi_sections	.debug_frame
  19              		.section	.text.servus_SetPin,"ax",%progbits
  20              		.align	1
  21              		.thumb
  22              		.thumb_func
  24              	servus_SetPin:
  25              	.LFB5:
  26              		.file 1 "uc_libc_dev/motors/servus.c"
   1:uc_libc_dev/motors/servus.c **** #include "servus.h"
   2:uc_libc_dev/motors/servus.c **** 
   3:uc_libc_dev/motors/servus.c **** 
   4:uc_libc_dev/motors/servus.c **** // COMPORTAMENTO DO SERVOS - resolução em 10uS
   5:uc_libc_dev/motors/servus.c **** //                       TH             TL
   6:uc_libc_dev/motors/servus.c **** // Pulso para o servo: ######________________________
   7:uc_libc_dev/motors/servus.c **** //
   8:uc_libc_dev/motors/servus.c **** // Tempos TH	Servo normal	Servo de modo continuo
   9:uc_libc_dev/motors/servus.c **** // 1000ms		0º 				Máxima velocidade sentido antihorário
  10:uc_libc_dev/motors/servus.c **** // 1250ms		45º 			Média velocidade sentido antihorário
  11:uc_libc_dev/motors/servus.c **** // 1500ms		90º				Parado
  12:uc_libc_dev/motors/servus.c **** // 1750ms		135º 			Média velocidade sentido horário
  13:uc_libc_dev/motors/servus.c **** // 2000ms		180º			Máxima velocidade sentido horário
  14:uc_libc_dev/motors/servus.c **** // TL = 20ms
  15:uc_libc_dev/motors/servus.c **** 
  16:uc_libc_dev/motors/servus.c **** 
  17:uc_libc_dev/motors/servus.c **** // COMPORTAMENTO DO SENSORES ULTRASOM
  18:uc_libc_dev/motors/servus.c **** //          (10uS) trigger      (200uS) Tempo de   	    (200uS) Tempo que o  	(100us) Resposta 	(38
  19:uc_libc_dev/motors/servus.c **** //			 para o módulo	  excitação do ultrasom      módulo espera para  	 de aceitação		   Quando enco
  20:uc_libc_dev/motors/servus.c **** //							   (8 pulsos de 40Khz)	  começar a leiturado eco      do trigger
  21:uc_libc_dev/motors/servus.c **** // --------|--------------|-------------------------|-------------------------|-------------------|
  22:uc_libc_dev/motors/servus.c **** // _________HHHHHHHHHHHHHH_________________________________________________________________________
  23:uc_libc_dev/motors/servus.c **** // ________________________XXXXXXXXXXXXXXXXXXXXXXXXX_______________________________________________
  24:uc_libc_dev/motors/servus.c **** // ___________________________________________________________________________HHHHHHHHHHHHHHHHHHHH_
  25:uc_libc_dev/motors/servus.c **** // ___________________________________________________________________________HHHHHHHHHHHHHHHHHHHHH
  26:uc_libc_dev/motors/servus.c **** // ___________________________________________________________________________HHHHHHHHHHHHHHHHHHHHH
  27:uc_libc_dev/motors/servus.c **** //		O pino echo elevará após a exicitação do ultrasom (8 pulsos de 40Khz) e ficará em alta pelo men
  28:uc_libc_dev/motors/servus.c **** 
  29:uc_libc_dev/motors/servus.c **** // ATENÇÃO: O período de medição no hc-sr04 é de 50ms, se houver outro trigger dentro desse interva
  30:uc_libc_dev/motors/servus.c **** 
  31:uc_libc_dev/motors/servus.c **** 
  32:uc_libc_dev/motors/servus.c **** #if (US04_USES == pdON)
  33:uc_libc_dev/motors/servus.c **** typedef struct {
  34:uc_libc_dev/motors/servus.c **** 	unsigned modeContinuous:1;				// Sinaliza para ficar fazendo medição de forma continua ou não
  35:uc_libc_dev/motors/servus.c **** 	volatile unsigned measure:1; 			// Sinaliza quando começar as medições
  36:uc_libc_dev/motors/servus.c **** 	volatile unsigned done:1;				// Sinaliza quando as medições estão prontas
  37:uc_libc_dev/motors/servus.c **** 	volatile int Fdetected;
  38:uc_libc_dev/motors/servus.c **** 	volatile int Ftriggerok;
  39:uc_libc_dev/motors/servus.c **** 	volatile uint FCont;					// Contador micro segundos para o gerenciador do US
  40:uc_libc_dev/motors/servus.c **** 	volatile int FModule;					// Guarda o módulo atual para medição
  41:uc_libc_dev/motors/servus.c **** 	volatile uint measurements[US04_N_MODULE];
  42:uc_libc_dev/motors/servus.c **** } tUs04;
  43:uc_libc_dev/motors/servus.c **** static tUs04 us04;
  44:uc_libc_dev/motors/servus.c **** static void us04_Trigger(uint module, uint action);
  45:uc_libc_dev/motors/servus.c **** static uint us04_Echo(uint module);
  46:uc_libc_dev/motors/servus.c **** #endif // #if (US04_USES == pdON)
  47:uc_libc_dev/motors/servus.c **** 
  48:uc_libc_dev/motors/servus.c **** typedef struct {
  49:uc_libc_dev/motors/servus.c **** 	volatile unsigned enable:1;
  50:uc_libc_dev/motors/servus.c **** 	volatile uint pos;
  51:uc_libc_dev/motors/servus.c **** 	volatile uint pos_load;
  52:uc_libc_dev/motors/servus.c **** 	volatile uint pos_count;
  53:uc_libc_dev/motors/servus.c **** 	volatile uint interval_count;
  54:uc_libc_dev/motors/servus.c **** 		#define INTERVAL_COUNT 20000
  55:uc_libc_dev/motors/servus.c **** } tServoCtrl;
  56:uc_libc_dev/motors/servus.c **** 
  57:uc_libc_dev/motors/servus.c **** static tServoCtrl servoCtrl[SERVO_N_MODULE];
  58:uc_libc_dev/motors/servus.c **** 
  59:uc_libc_dev/motors/servus.c **** static void servus_CallSytem(void);
  60:uc_libc_dev/motors/servus.c **** 
  61:uc_libc_dev/motors/servus.c **** void servus_Init(uint en) {
  62:uc_libc_dev/motors/servus.c **** 	uint x;	for (x=0;x<SERVO_N_MODULE;x++) {
  63:uc_libc_dev/motors/servus.c **** 		servoCtrl[x].interval_count = 0;
  64:uc_libc_dev/motors/servus.c **** 		servoCtrl[x].pos_count= 0;
  65:uc_libc_dev/motors/servus.c **** 		servoCtrl[x].pos= 1500;
  66:uc_libc_dev/motors/servus.c **** 		servoCtrl[x].enable = en;
  67:uc_libc_dev/motors/servus.c **** 	}
  68:uc_libc_dev/motors/servus.c **** 
  69:uc_libc_dev/motors/servus.c **** 	#if (US04_USES == pdON)
  70:uc_libc_dev/motors/servus.c **** 	us04_SetupPortsModule1();
  71:uc_libc_dev/motors/servus.c **** 	#if (US04_N_MODULE > 1 )
  72:uc_libc_dev/motors/servus.c **** 	us04_SetupPortsModule2();
  73:uc_libc_dev/motors/servus.c **** 	#endif
  74:uc_libc_dev/motors/servus.c **** 	#if (US04_N_MODULE > 2 )
  75:uc_libc_dev/motors/servus.c **** 	us04_SetupPortsModule3();
  76:uc_libc_dev/motors/servus.c **** 	#endif
  77:uc_libc_dev/motors/servus.c **** 	#if (US04_N_MODULE > 3 )
  78:uc_libc_dev/motors/servus.c **** 	us04_SetupPortsModule4();
  79:uc_libc_dev/motors/servus.c **** 	#endif
  80:uc_libc_dev/motors/servus.c **** 
  81:uc_libc_dev/motors/servus.c **** 	us04.modeContinuous = 0;	// Não medir de forma continua
  82:uc_libc_dev/motors/servus.c **** 	us04.measure = 0; 			// Sinaliza para não fazer as medições
  83:uc_libc_dev/motors/servus.c **** 	us04.done = 0;				// Nenhuma medição foi realizada ainda
  84:uc_libc_dev/motors/servus.c **** 	us04.FModule = 1;			// Sinaliza que o módulo 1 será o primeiro a ser medido
  85:uc_libc_dev/motors/servus.c **** 	us04.FCont = 0;				// Contador em micro segundos do CallSystem do US
  86:uc_libc_dev/motors/servus.c **** 
  87:uc_libc_dev/motors/servus.c **** 	for (x=0;x<US04_N_MODULE;x++) {
  88:uc_libc_dev/motors/servus.c **** 		us04.measurements[x] = 0;
  89:uc_libc_dev/motors/servus.c **** 		us04_Trigger(x, pdOFF); // Desligar sinais dos triggers dos módulos
  90:uc_libc_dev/motors/servus.c **** 	}
  91:uc_libc_dev/motors/servus.c **** 
  92:uc_libc_dev/motors/servus.c **** 	us04.Fdetected = 0;		// Sinaliza para não há objeto detectado
  93:uc_libc_dev/motors/servus.c **** 	us04.Ftriggerok = 0;		// Inicializar pedido de trigger
  94:uc_libc_dev/motors/servus.c **** 
  95:uc_libc_dev/motors/servus.c **** 	#if US04_USE_DEBUG == pdON
  96:uc_libc_dev/motors/servus.c **** 	US04_DBGTRIGGER_DIR |= US04_DBGTRIGGER;
  97:uc_libc_dev/motors/servus.c **** 	US04_DBGTRIGGER_CLR = US04_DBGTRIGGER;
  98:uc_libc_dev/motors/servus.c **** 	US04_DBGTRIGGEROK_DIR |= US04_DBGTRIGGEROK;
  99:uc_libc_dev/motors/servus.c **** 	US04_DBGTRIGGEROK_CLR = US04_DBGTRIGGEROK;
 100:uc_libc_dev/motors/servus.c **** 	US04_DBGDETECTED_DIR |= US04_DBGDETECTED;
 101:uc_libc_dev/motors/servus.c **** 	US04_DBGDETECTED_CLR = US04_DBGDETECTED;
 102:uc_libc_dev/motors/servus.c **** 	#endif
 103:uc_libc_dev/motors/servus.c **** 	#endif //#if (US04_USES == pdON)
 104:uc_libc_dev/motors/servus.c **** 
 105:uc_libc_dev/motors/servus.c **** 	servo1_SetupPorts();
 106:uc_libc_dev/motors/servus.c **** 	#if (SERVO_N_MODULE > 1)
 107:uc_libc_dev/motors/servus.c **** 	servo2_SetupPorts();
 108:uc_libc_dev/motors/servus.c **** 	#endif
 109:uc_libc_dev/motors/servus.c **** 	#if (SERVO_N_MODULE > 2)
 110:uc_libc_dev/motors/servus.c **** 	servo3_SetupPorts();
 111:uc_libc_dev/motors/servus.c **** 	#endif
 112:uc_libc_dev/motors/servus.c **** 	#if (SERVO_N_MODULE > 3)
 113:uc_libc_dev/motors/servus.c **** 	servo4_SetupPorts();
 114:uc_libc_dev/motors/servus.c **** 	#endif
 115:uc_libc_dev/motors/servus.c **** 	#if (SERVO_N_MODULE > 4)
 116:uc_libc_dev/motors/servus.c **** 	servo5_SetupPorts();
 117:uc_libc_dev/motors/servus.c **** 	#endif
 118:uc_libc_dev/motors/servus.c **** 	#if (SERVO_N_MODULE > 5)
 119:uc_libc_dev/motors/servus.c **** 	servo6_SetupPorts();
 120:uc_libc_dev/motors/servus.c **** 	#endif
 121:uc_libc_dev/motors/servus.c **** 	#if (SERVO_N_MODULE > 6)
 122:uc_libc_dev/motors/servus.c **** 	servo7_SetupPorts();
 123:uc_libc_dev/motors/servus.c **** 	#endif
 124:uc_libc_dev/motors/servus.c **** 
 125:uc_libc_dev/motors/servus.c **** 	servus_TimeInit();
 126:uc_libc_dev/motors/servus.c **** 	servus_SetIntHandler(servus_CallSytem);
 127:uc_libc_dev/motors/servus.c **** }
 128:uc_libc_dev/motors/servus.c **** 
 129:uc_libc_dev/motors/servus.c **** void servus_Finish(void) {
 130:uc_libc_dev/motors/servus.c **** 	servus_TimeStop();		// Desligo o timer para não gerar int para servus_CallSytem
 131:uc_libc_dev/motors/servus.c **** }
 132:uc_libc_dev/motors/servus.c **** 
 133:uc_libc_dev/motors/servus.c **** 
 134:uc_libc_dev/motors/servus.c **** #if (US04_USES == pdON)
 135:uc_libc_dev/motors/servus.c **** 
 136:uc_libc_dev/motors/servus.c **** // Inicializa a medição com ultrasom com modo continuo ou uma única medição
 137:uc_libc_dev/motors/servus.c **** // parametro modeCont:  pdFALSE: sinaliza para fazer uma única medição
 138:uc_libc_dev/motors/servus.c **** //						pdTRUE: Sinaliza para medir de forma continua
 139:uc_libc_dev/motors/servus.c **** void us04_StartMeasure(uint modeCont) {
 140:uc_libc_dev/motors/servus.c **** 	us04.modeContinuous = modeCont;
 141:uc_libc_dev/motors/servus.c **** 	if (us04.measure) return;
 142:uc_libc_dev/motors/servus.c **** 	us04.done = 0; 			// Sinaliza que a conversão não está pronta
 143:uc_libc_dev/motors/servus.c **** 	us04.measure = 1; 		// Sinaliza para fazer as medições
 144:uc_libc_dev/motors/servus.c **** }
 145:uc_libc_dev/motors/servus.c **** 
 146:uc_libc_dev/motors/servus.c **** // para qualquer medição seja no modo continuo ou não
 147:uc_libc_dev/motors/servus.c **** void us04_StopMeasure(void) {
 148:uc_libc_dev/motors/servus.c **** 	us04.modeContinuous = 0;
 149:uc_libc_dev/motors/servus.c **** 	us04.measure = 0; 		// Sinaliza para fazer as medições
 150:uc_libc_dev/motors/servus.c **** }
 151:uc_libc_dev/motors/servus.c **** 
 152:uc_libc_dev/motors/servus.c **** // Retorna em CM o valor lido pelo módulo US
 153:uc_libc_dev/motors/servus.c **** // Parametro servoSel: Sinaliza qual o servo a receber a nova posição, valor de 1 a US04_N_MODULE
 154:uc_libc_dev/motors/servus.c **** // Retorna: 0: Se não encontrou o ostáculo, senão retorna com o valor em centimetros
 155:uc_libc_dev/motors/servus.c **** //			errDEVICE_NOT_FOUND: Se o módulo não existe
 156:uc_libc_dev/motors/servus.c **** //			errDEVICE_VALUE_NOT_READY: Se o módulo ainda não terminou a medição
 157:uc_libc_dev/motors/servus.c **** int us04_ReadMeasureCM(uint module) {
 158:uc_libc_dev/motors/servus.c **** 	if ( (module == 0) || (module > US04_N_MODULE)) return errDEVICE_NOT_FOUND;
 159:uc_libc_dev/motors/servus.c **** 	if (us04.done == 0) return errDEVICE_VALUE_NOT_READY;
 160:uc_libc_dev/motors/servus.c **** 	if (us04.measurements[module-1] == 0) return 0;
 161:uc_libc_dev/motors/servus.c **** 	return (us04.measurements[module-1]/58);
 162:uc_libc_dev/motors/servus.c **** }
 163:uc_libc_dev/motors/servus.c **** 
 164:uc_libc_dev/motors/servus.c **** // Ligar ou desligar o trigger do módulo
 165:uc_libc_dev/motors/servus.c **** static void us04_Trigger(uint module, uint action) {
 166:uc_libc_dev/motors/servus.c **** 	if (module == 1) us04_TriggerModule1(action);
 167:uc_libc_dev/motors/servus.c **** 	#if (US04_N_MODULE > 1 )
 168:uc_libc_dev/motors/servus.c **** 	if (module == 2) us04_TriggerModule2(action);
 169:uc_libc_dev/motors/servus.c **** 	#endif
 170:uc_libc_dev/motors/servus.c **** 	#if (US04_N_MODULE > 2 )
 171:uc_libc_dev/motors/servus.c **** 	if (module == 3) us04_TriggerModule3(action);
 172:uc_libc_dev/motors/servus.c **** 	#endif
 173:uc_libc_dev/motors/servus.c **** 	#if (US04_N_MODULE > 3 )
 174:uc_libc_dev/motors/servus.c **** 	if (module == 4) us04_TriggerModule4(action);
 175:uc_libc_dev/motors/servus.c **** 	#endif
 176:uc_libc_dev/motors/servus.c **** }
 177:uc_libc_dev/motors/servus.c **** 
 178:uc_libc_dev/motors/servus.c **** // retorna 1 se o pino de eco = 1 senão retorna 0
 179:uc_libc_dev/motors/servus.c **** static uint us04_Echo(uint module) {
 180:uc_libc_dev/motors/servus.c **** 	uint result = 0;
 181:uc_libc_dev/motors/servus.c **** 	if ((module == 1) && (us04_EchoModule1() > 0)) result = 1;
 182:uc_libc_dev/motors/servus.c **** 	#if (US04_N_MODULE > 1 )
 183:uc_libc_dev/motors/servus.c **** 	if ((module == 2) && (us04_EchoModule2() > 0)) result = 1;
 184:uc_libc_dev/motors/servus.c **** 	#endif
 185:uc_libc_dev/motors/servus.c **** 	#if (US04_N_MODULE > 2 )
 186:uc_libc_dev/motors/servus.c **** 	if ((module == 3) && (us04_EchoModule3() > 0)) result = 1;
 187:uc_libc_dev/motors/servus.c **** 	#endif
 188:uc_libc_dev/motors/servus.c **** 	#if (US04_N_MODULE > 3 )
 189:uc_libc_dev/motors/servus.c **** 	if ((module == 4) && (us04_EchoModule4() > 0)) result = 1;
 190:uc_libc_dev/motors/servus.c **** 	#endif
 191:uc_libc_dev/motors/servus.c **** 
 192:uc_libc_dev/motors/servus.c **** 	return result;
 193:uc_libc_dev/motors/servus.c **** }
 194:uc_libc_dev/motors/servus.c **** #endif //#if (US04_USES == pdON)
 195:uc_libc_dev/motors/servus.c **** 
 196:uc_libc_dev/motors/servus.c **** // Determina a posição do servo motor
 197:uc_libc_dev/motors/servus.c **** // Parametro servoSel: Sinaliza qual o servo a receber a nova posição, valor de 1 a SERVO_N_MODULE
 198:uc_libc_dev/motors/servus.c **** // 				us: tempo em microsegundos
 199:uc_libc_dev/motors/servus.c **** // Retorna: pdPASS se o comando foi executado com sucesso
 200:uc_libc_dev/motors/servus.c **** //			errDEVICE_NOT_FOUND: Se o servo não existe
 201:uc_libc_dev/motors/servus.c **** //			errDEVICE_VALUE_INVALID: Valor inválido
 202:uc_libc_dev/motors/servus.c **** int servus_SetPos(uint servo, int us) {
 203:uc_libc_dev/motors/servus.c **** 	if ( (servo==0) || (servo>SERVO_N_MODULE) ) return errDEVICE_NOT_FOUND;
 204:uc_libc_dev/motors/servus.c **** 	if ( (us<100) || (us>3000)) return errDEVICE_VALUE_INVALID;
 205:uc_libc_dev/motors/servus.c **** 	servoCtrl[servo-1].pos_load = us;
 206:uc_libc_dev/motors/servus.c **** 
 207:uc_libc_dev/motors/servus.c **** 	return pdPASS;
 208:uc_libc_dev/motors/servus.c **** }
 209:uc_libc_dev/motors/servus.c **** 
 210:uc_libc_dev/motors/servus.c **** // Habilita não a saida PWM para o servo
 211:uc_libc_dev/motors/servus.c **** // Parametro servoSel: Sinaliza qual o servo a receber a nova posição, valor de 1 a SERVO_N_MODULE
 212:uc_libc_dev/motors/servus.c **** // Retorna: pdPASS se o comando foi executado com sucesso
 213:uc_libc_dev/motors/servus.c **** //			errDEVICE_NOT_FOUND: Se o servo não existe
 214:uc_libc_dev/motors/servus.c **** int servus_Enable(uint servo, uint en) {
 215:uc_libc_dev/motors/servus.c **** 	if ( (servo == 0) || (servo > SERVO_N_MODULE) ) return errDEVICE_NOT_FOUND;
 216:uc_libc_dev/motors/servus.c **** 	servoCtrl[servo-1].enable = (en == 0)?0:1;
 217:uc_libc_dev/motors/servus.c **** 	return pdPASS;
 218:uc_libc_dev/motors/servus.c **** }
 219:uc_libc_dev/motors/servus.c **** 
 220:uc_libc_dev/motors/servus.c **** // Checa se o servo está habilitado ou não
 221:uc_libc_dev/motors/servus.c **** // Parametro servoSel: Sinaliza qual o servo a receber a nova posição, valor de 1 a SERVO_N_MODULE
 222:uc_libc_dev/motors/servus.c **** // Retorna: pdON pu pdOFF
 223:uc_libc_dev/motors/servus.c **** //			errDEVICE_NOT_FOUND: Se o servo não existe
 224:uc_libc_dev/motors/servus.c **** int servus_Enabled(uint servo) {
 225:uc_libc_dev/motors/servus.c **** 	if ( (servo == 0) || (servo > SERVO_N_MODULE) ) return errDEVICE_NOT_FOUND;
 226:uc_libc_dev/motors/servus.c **** 	if (servoCtrl[servo-1].enable) return pdON; else return pdOFF;
 227:uc_libc_dev/motors/servus.c **** }
 228:uc_libc_dev/motors/servus.c **** 
 229:uc_libc_dev/motors/servus.c **** static inline void servus_SetPin(uint servo, uint act) {
  27              		.loc 1 229 0
  28              		.cfi_startproc
  29              		@ args = 0, pretend = 0, frame = 0
  30              		@ frame_needed = 0, uses_anonymous_args = 0
  31              		@ link register save eliminated.
  32              	.LVL0:
 230:uc_libc_dev/motors/servus.c **** 	act &= servoCtrl[servo].enable;
  33              		.loc 1 230 0
  34 0000 1423     		movs	r3, #20
  35 0002 4343     		muls	r3, r0, r3
  36 0004 144A     		ldr	r2, .L38
  37 0006 D358     		ldr	r3, [r2, r3]
  38 0008 03F00103 		and	r3, r3, #1
  39 000c 1940     		ands	r1, r1, r3
  40              	.LVL1:
 231:uc_libc_dev/motors/servus.c **** 
 232:uc_libc_dev/motors/servus.c **** 	if (servo == 0) {
  41              		.loc 1 232 0
  42 000e 10B9     		cbnz	r0, .L2
  43 0010 4FF48063 		mov	r3, #1024
  44 0014 0CE0     		b	.L27
  45              	.L2:
 233:uc_libc_dev/motors/servus.c **** 		if (act) SERVO1_SET = SERVO1; else SERVO1_CLR = SERVO1;
 234:uc_libc_dev/motors/servus.c **** 	}
 235:uc_libc_dev/motors/servus.c **** 
 236:uc_libc_dev/motors/servus.c **** 	#if (SERVO_N_MODULE > 1)
 237:uc_libc_dev/motors/servus.c **** 	if (servo == 1) {
  46              		.loc 1 237 0
  47 0016 0128     		cmp	r0, #1
  48 0018 02D1     		bne	.L5
  49 001a 4FF40073 		mov	r3, #512
  50 001e 07E0     		b	.L27
  51              	.L5:
 238:uc_libc_dev/motors/servus.c **** 		if (act) SERVO2_SET = SERVO2; else SERVO2_CLR = SERVO2;
 239:uc_libc_dev/motors/servus.c **** 	}
 240:uc_libc_dev/motors/servus.c **** 	#endif
 241:uc_libc_dev/motors/servus.c **** 
 242:uc_libc_dev/motors/servus.c **** 	#if (SERVO_N_MODULE > 2)
 243:uc_libc_dev/motors/servus.c **** 	if (servo == 2) {
  52              		.loc 1 243 0
  53 0020 0228     		cmp	r0, #2
  54 0022 02D1     		bne	.L8
  55 0024 4FF48073 		mov	r3, #256
  56 0028 02E0     		b	.L27
  57              	.L8:
 244:uc_libc_dev/motors/servus.c **** 		if (act) SERVO3_SET = SERVO3; else SERVO3_CLR = SERVO3;
 245:uc_libc_dev/motors/servus.c **** 	}
 246:uc_libc_dev/motors/servus.c **** 	#endif
 247:uc_libc_dev/motors/servus.c **** 
 248:uc_libc_dev/motors/servus.c **** 	#if (SERVO_N_MODULE > 3)
 249:uc_libc_dev/motors/servus.c **** 	if (servo == 3) {
  58              		.loc 1 249 0
  59 002a 0328     		cmp	r0, #3
  60 002c 06D1     		bne	.L34
  61 002e 1023     		movs	r3, #16
  62              	.L27:
 250:uc_libc_dev/motors/servus.c **** 		if (act) SERVO4_SET = SERVO4; else SERVO4_CLR = SERVO4;
 251:uc_libc_dev/motors/servus.c **** 	}
 252:uc_libc_dev/motors/servus.c **** 	#endif
 253:uc_libc_dev/motors/servus.c **** 
 254:uc_libc_dev/motors/servus.c **** 	#if (SERVO_N_MODULE > 4)
 255:uc_libc_dev/motors/servus.c **** 	if (servo == 4) {
 256:uc_libc_dev/motors/servus.c **** 		if (act) SERVO5_SET = SERVO5; else SERVO5_CLR = SERVO5;
 257:uc_libc_dev/motors/servus.c **** 	}
 258:uc_libc_dev/motors/servus.c **** 	#endif
 259:uc_libc_dev/motors/servus.c **** 
 260:uc_libc_dev/motors/servus.c **** 	#if (SERVO_N_MODULE > 5)
 261:uc_libc_dev/motors/servus.c **** 	if (servo == 5) {
 262:uc_libc_dev/motors/servus.c **** 		if (act) SERVO6_SET = SERVO6; else SERVO6_CLR = SERVO6;
 263:uc_libc_dev/motors/servus.c **** 	}
 264:uc_libc_dev/motors/servus.c **** 	#endif
 265:uc_libc_dev/motors/servus.c **** 
 266:uc_libc_dev/motors/servus.c **** 	#if (SERVO_N_MODULE > 6)
 267:uc_libc_dev/motors/servus.c **** 	if (servo == 6) {
 268:uc_libc_dev/motors/servus.c **** 		if (act) SERVO7_SET = SERVO7; else SERVO7_CLR = SERVO7;
  63              		.loc 1 268 0
  64 0030 09B1     		cbz	r1, .L16
  65              		.loc 1 268 0 is_stmt 0 discriminator 1
  66 0032 0A4A     		ldr	r2, .L38+4
  67 0034 00E0     		b	.L24
  68              	.L16:
  69              		.loc 1 268 0 discriminator 2
  70 0036 0A4A     		ldr	r2, .L38+8
  71              	.L24:
  72 0038 1360     		str	r3, [r2]
 269:uc_libc_dev/motors/servus.c **** 	}
 270:uc_libc_dev/motors/servus.c **** 	#endif
 271:uc_libc_dev/motors/servus.c **** }
  73              		.loc 1 271 0 is_stmt 1 discriminator 2
  74 003a 7047     		bx	lr
  75              	.L34:
 255:uc_libc_dev/motors/servus.c **** 		if (act) SERVO5_SET = SERVO5; else SERVO5_CLR = SERVO5;
  76              		.loc 1 255 0
  77 003c 0428     		cmp	r0, #4
  78 003e 01D1     		bne	.L35
  79 0040 0223     		movs	r3, #2
  80 0042 F5E7     		b	.L27
  81              	.L35:
 261:uc_libc_dev/motors/servus.c **** 		if (act) SERVO6_SET = SERVO6; else SERVO6_CLR = SERVO6;
  82              		.loc 1 261 0
  83 0044 0528     		cmp	r0, #5
  84 0046 01D1     		bne	.L36
  85 0048 0123     		movs	r3, #1
  86 004a F1E7     		b	.L27
  87              	.L36:
 267:uc_libc_dev/motors/servus.c **** 		if (act) SERVO7_SET = SERVO7; else SERVO7_CLR = SERVO7;
  88              		.loc 1 267 0
  89 004c 0628     		cmp	r0, #6
  90 004e 02D1     		bne	.L37
  91 0050 4FF48043 		mov	r3, #16384
  92 0054 ECE7     		b	.L27
  93              	.L37:
  94 0056 7047     		bx	lr
  95              	.L39:
  96              		.align	2
  97              	.L38:
  98 0058 00000000 		.word	.LANCHOR0
  99 005c 38C00920 		.word	537509944
 100 0060 3CC00920 		.word	537509948
 101              		.cfi_endproc
 102              	.LFE5:
 104              		.section	.text.servus_CallSytem,"ax",%progbits
 105              		.align	1
 106              		.thumb
 107              		.thumb_func
 109              	servus_CallSytem:
 110              	.LFB6:
 272:uc_libc_dev/motors/servus.c **** 
 273:uc_libc_dev/motors/servus.c **** // Tick de sistema para controle dos servos e medições dos módulos de ultrasom.
 274:uc_libc_dev/motors/servus.c **** //	Esta função será chamada a cada 10us pelo timer do uC
 275:uc_libc_dev/motors/servus.c **** static void servus_CallSytem(void) {
 111              		.loc 1 275 0
 112              		.cfi_startproc
 113              		@ args = 0, pretend = 0, frame = 0
 114              		@ frame_needed = 0, uses_anonymous_args = 0
 115              	.LVL2:
 116 0000 F8B5     		push	{r3, r4, r5, r6, r7, lr}
 117              	.LCFI0:
 118              		.cfi_def_cfa_offset 24
 119              		.cfi_offset 3, -24
 120              		.cfi_offset 4, -20
 121              		.cfi_offset 5, -16
 122              		.cfi_offset 6, -12
 123              		.cfi_offset 7, -8
 124              		.cfi_offset 14, -4
 276:uc_libc_dev/motors/servus.c **** 	// ###############################################################################################
 277:uc_libc_dev/motors/servus.c **** 	// CONTROLE DOS SERVOS
 278:uc_libc_dev/motors/servus.c **** 	uint x;	for (x=0;x<SERVO_N_MODULE;x++) {
 125              		.loc 1 278 0
 126 0002 0024     		movs	r4, #0
 279:uc_libc_dev/motors/servus.c **** 		if (servoCtrl[x].interval_count < INTERVAL_COUNT-servoCtrl[x].pos) {
 280:uc_libc_dev/motors/servus.c **** 			servoCtrl[x].interval_count+=10;
 281:uc_libc_dev/motors/servus.c **** 			servoCtrl[x].pos_count=0;
 282:uc_libc_dev/motors/servus.c **** 			servus_SetPin(x, pdOFF);
 283:uc_libc_dev/motors/servus.c **** 		} else if (servoCtrl[x].pos_count < servoCtrl[x].pos) {
 284:uc_libc_dev/motors/servus.c **** 			servoCtrl[x].pos_count+=10;
 285:uc_libc_dev/motors/servus.c **** 			servus_SetPin(x, pdON);
 286:uc_libc_dev/motors/servus.c **** 		} else {
 287:uc_libc_dev/motors/servus.c **** 			servoCtrl[x].interval_count = 0;
 127              		.loc 1 287 0
 128 0004 2546     		mov	r5, r4
 279:uc_libc_dev/motors/servus.c **** 		if (servoCtrl[x].interval_count < INTERVAL_COUNT-servoCtrl[x].pos) {
 129              		.loc 1 279 0
 130 0006 124E     		ldr	r6, .L47
 131 0008 1427     		movs	r7, #20
 132              	.LVL3:
 133              	.L44:
 134 000a 07FB0463 		mla	r3, r7, r4, r6
 135 000e 1969     		ldr	r1, [r3, #16]
 136 0010 5A68     		ldr	r2, [r3, #4]
 137 0012 C2F59C42 		rsb	r2, r2, #19968
 138 0016 2032     		adds	r2, r2, #32
 139 0018 9142     		cmp	r1, r2
 140 001a 05D2     		bcs	.L41
 280:uc_libc_dev/motors/servus.c **** 			servoCtrl[x].pos_count=0;
 141              		.loc 1 280 0
 142 001c 1A69     		ldr	r2, [r3, #16]
 282:uc_libc_dev/motors/servus.c **** 		} else if (servoCtrl[x].pos_count < servoCtrl[x].pos) {
 143              		.loc 1 282 0
 144 001e 0021     		movs	r1, #0
 280:uc_libc_dev/motors/servus.c **** 			servoCtrl[x].pos_count=0;
 145              		.loc 1 280 0
 146 0020 0A32     		adds	r2, r2, #10
 147 0022 1A61     		str	r2, [r3, #16]
 281:uc_libc_dev/motors/servus.c **** 			servus_SetPin(x, pdOFF);
 148              		.loc 1 281 0
 149 0024 DD60     		str	r5, [r3, #12]
 150 0026 07E0     		b	.L46
 151              	.L41:
 283:uc_libc_dev/motors/servus.c **** 			servoCtrl[x].pos_count+=10;
 152              		.loc 1 283 0
 153 0028 D968     		ldr	r1, [r3, #12]
 154 002a 5A68     		ldr	r2, [r3, #4]
 155 002c 9142     		cmp	r1, r2
 156 002e 07D2     		bcs	.L43
 284:uc_libc_dev/motors/servus.c **** 			servus_SetPin(x, pdON);
 157              		.loc 1 284 0
 158 0030 DA68     		ldr	r2, [r3, #12]
 285:uc_libc_dev/motors/servus.c **** 		} else {
 159              		.loc 1 285 0
 160 0032 0121     		movs	r1, #1
 284:uc_libc_dev/motors/servus.c **** 			servus_SetPin(x, pdON);
 161              		.loc 1 284 0
 162 0034 0A32     		adds	r2, r2, #10
 163 0036 DA60     		str	r2, [r3, #12]
 164              	.L46:
 285:uc_libc_dev/motors/servus.c **** 		} else {
 165              		.loc 1 285 0
 166 0038 2046     		mov	r0, r4
 167 003a FFF7FEFF 		bl	servus_SetPin
 168              	.LVL4:
 169 003e 02E0     		b	.L42
 170              	.L43:
 171              		.loc 1 287 0
 172 0040 1D61     		str	r5, [r3, #16]
 288:uc_libc_dev/motors/servus.c **** 			servoCtrl[x].pos = servoCtrl[x].pos_load;
 173              		.loc 1 288 0
 174 0042 9A68     		ldr	r2, [r3, #8]
 175 0044 5A60     		str	r2, [r3, #4]
 176              	.L42:
 278:uc_libc_dev/motors/servus.c **** 		if (servoCtrl[x].interval_count < INTERVAL_COUNT-servoCtrl[x].pos) {
 177              		.loc 1 278 0 discriminator 2
 178 0046 0134     		adds	r4, r4, #1
 179              	.LVL5:
 180 0048 072C     		cmp	r4, #7
 181 004a DED1     		bne	.L44
 289:uc_libc_dev/motors/servus.c **** 		}
 290:uc_libc_dev/motors/servus.c **** 	}
 291:uc_libc_dev/motors/servus.c **** 
 292:uc_libc_dev/motors/servus.c **** 	// ###############################################################################################
 293:uc_libc_dev/motors/servus.c **** 	// CONTROLE DO MÓDULOS ULTRASOM
 294:uc_libc_dev/motors/servus.c **** 	#if (US04_USES == pdON)
 295:uc_libc_dev/motors/servus.c **** 	#if US04_USE_DEBUG == pdOFF
 296:uc_libc_dev/motors/servus.c **** 	if (us04.measure == 0) return;
 297:uc_libc_dev/motors/servus.c **** 	#endif
 298:uc_libc_dev/motors/servus.c **** 
 299:uc_libc_dev/motors/servus.c **** 	// OS VALORES SÃO BASEADOS NA CHAMADA DO TICK DE ULTRASOM A CADA 10uS
 300:uc_libc_dev/motors/servus.c **** 	// Passo 1 (tempo 0uS)			: Desligar trigger do módulo e manter por 10uS
 301:uc_libc_dev/motors/servus.c **** 	// Passo 2 (tempo 10uS)			: Ligar trigger do módulo e manter por 10uS
 302:uc_libc_dev/motors/servus.c **** 	// Passo 3 (tempo 20uS)			: Desligar o trigger e dar inicio do tempo para exicitação do ultrasom (
 303:uc_libc_dev/motors/servus.c **** 	// Passo 4 (tempo 420uS a 38ms)	: Inicio da verificação do sinal do eco. Se a primeira leitura for
 304:uc_libc_dev/motors/servus.c **** 	// Passo 5 (tempo MIN 60ms)		: Reiniciar o gerenciador para a próxima leitura. Acrescentado um tem
 305:uc_libc_dev/motors/servus.c **** 
 306:uc_libc_dev/motors/servus.c **** 	// EMITIR SINAL DE TRIGGER. Iniciar em 1 para que os triggers fiquem pelo menos 10us em nível baix
 307:uc_libc_dev/motors/servus.c **** 	if (us04.FCont == 1) {
 308:uc_libc_dev/motors/servus.c **** 		us04_Trigger(us04.FModule, pdON); 				// Emitir sinal de trigger para o módulo atual
 309:uc_libc_dev/motors/servus.c **** 		if (us04.modeContinuous == 0) us04.done = 0;	// Medições não pronta
 310:uc_libc_dev/motors/servus.c **** 		us04.measurements[us04.FModule-1] = 0;			// limpar distancia registrada do módulo atual
 311:uc_libc_dev/motors/servus.c **** 
 312:uc_libc_dev/motors/servus.c **** 		#if US04_USE_DEBUG == pdON
 313:uc_libc_dev/motors/servus.c **** 		US04_DBGTRIGGER_SET = US04_DBGTRIGGER;
 314:uc_libc_dev/motors/servus.c **** 		#endif
 315:uc_libc_dev/motors/servus.c **** 
 316:uc_libc_dev/motors/servus.c **** 	// DESLIGAR TRIGGER E ESPERAR PELA EXICITAÇÃO DO ULTRASOM
 317:uc_libc_dev/motors/servus.c **** 	} else if (us04.FCont == 2) {
 318:uc_libc_dev/motors/servus.c **** 		us04_Trigger(us04.FModule, pdOFF); 		// Desligar sinal de trigger
 319:uc_libc_dev/motors/servus.c **** 
 320:uc_libc_dev/motors/servus.c **** 		#if US04_USE_DEBUG == pdON
 321:uc_libc_dev/motors/servus.c **** 		US04_DBGTRIGGER_CLR = US04_DBGTRIGGER;
 322:uc_libc_dev/motors/servus.c **** 		#endif
 323:uc_libc_dev/motors/servus.c **** 
 324:uc_libc_dev/motors/servus.c **** 	// INICIO DA VERIFICAÇÃO DA DETECÇÃO DE OBTÁCULO (entre 420us a 38000us)
 325:uc_libc_dev/motors/servus.c **** 	} else if ( (us04.FCont > 42) && (us04.FCont <= 3800) ) {
 326:uc_libc_dev/motors/servus.c **** 		if (us04.Ftriggerok == 0) 										// Checa se o módulo aceitou o pedido do trigger
 327:uc_libc_dev/motors/servus.c **** 			us04.Ftriggerok = us04_Echo(us04.FModule); 						// Verificar se o módulo aceitou o trigger (ech
 328:uc_libc_dev/motors/servus.c **** 		else if (us04.Fdetected == 0) { 									// Checa se ainda não registramos a distancia do objeto 
 329:uc_libc_dev/motors/servus.c **** 			if (us04_Echo(us04.FModule) == 0) { 					// Checa se há objeto detectado (echo = 0)
 330:uc_libc_dev/motors/servus.c **** 				us04.measurements[us04.FModule-1] = (us04.FCont-41)*10;		// Registra o tempo da deteção.
 331:uc_libc_dev/motors/servus.c **** 																		// 		Diminuir por 40 (400uS) pois cotarmos a partir da excitação e tempo de inici
 332:uc_libc_dev/motors/servus.c **** 																		// 		Multiplicar por 10 porque estamos contando em 10 e 10 us
 333:uc_libc_dev/motors/servus.c **** 				us04.Fdetected = 1;											// Trava a leitura
 334:uc_libc_dev/motors/servus.c **** 			}
 335:uc_libc_dev/motors/servus.c **** 		}
 336:uc_libc_dev/motors/servus.c **** 
 337:uc_libc_dev/motors/servus.c **** 		#if US04_USE_DEBUG == pdON
 338:uc_libc_dev/motors/servus.c **** 		if (us04.Ftriggerok == 1)
 339:uc_libc_dev/motors/servus.c **** 				US04_DBGTRIGGEROK_SET = US04_DBGTRIGGEROK;
 340:uc_libc_dev/motors/servus.c **** 		else	US04_DBGTRIGGEROK_CLR = US04_DBGTRIGGEROK;
 341:uc_libc_dev/motors/servus.c **** 
 342:uc_libc_dev/motors/servus.c **** 		if (us04.Fdetected == 1)
 343:uc_libc_dev/motors/servus.c **** 				US04_DBGDETECTED_SET = US04_DBGDETECTED;
 344:uc_libc_dev/motors/servus.c **** 		else 	US04_DBGDETECTED_CLR = US04_DBGDETECTED;
 345:uc_libc_dev/motors/servus.c **** 		#endif
 346:uc_libc_dev/motors/servus.c **** 	}
 347:uc_libc_dev/motors/servus.c **** 	#if US04_USE_DEBUG == pdON
 348:uc_libc_dev/motors/servus.c **** 	else if (us04.FCont > 3800) {
 349:uc_libc_dev/motors/servus.c **** 		US04_DBGTRIGGEROK_CLR = US04_DBGTRIGGEROK;
 350:uc_libc_dev/motors/servus.c **** 		US04_DBGDETECTED_CLR = US04_DBGDETECTED;
 351:uc_libc_dev/motors/servus.c **** 	}
 352:uc_libc_dev/motors/servus.c **** 	#endif
 353:uc_libc_dev/motors/servus.c **** 
 354:uc_libc_dev/motors/servus.c **** 	// ESPERAR O TEMPO PARA QUE O MÓDULO FINALIZE O PROCESSO DE MEDIÇÃO (MIN 50MS, MAS ESTAMOS DANDO M
 355:uc_libc_dev/motors/servus.c **** 	if (us04.FCont == US04_END_MEASURE) {
 356:uc_libc_dev/motors/servus.c **** 		// Ir para o próximo módulo ou finalizar a leitura
 357:uc_libc_dev/motors/servus.c **** 		if (us04.FModule == US04_N_MODULE) {
 358:uc_libc_dev/motors/servus.c **** 			us04.FModule = 1;		// Sinaliza para meidor módulo 1
 359:uc_libc_dev/motors/servus.c **** 			us04.done = 1;		// Sinaliza que a medição está completa
 360:uc_libc_dev/motors/servus.c **** 			// Caso não for medição de forma continua, sinaliza para parar as medições e esperar pelo próxim
 361:uc_libc_dev/motors/servus.c **** 			if (us04.modeContinuous == 0) us04.measure = 0;
 362:uc_libc_dev/motors/servus.c **** 		} else us04.FModule++;		// Sinaliza para medir o próximo módulo
 363:uc_libc_dev/motors/servus.c **** 
 364:uc_libc_dev/motors/servus.c **** 		us04.FCont = 0;
 365:uc_libc_dev/motors/servus.c **** 		us04.Fdetected = 0;;		// Sinaliza para não há objeto detectado
 366:uc_libc_dev/motors/servus.c **** 		us04.Ftriggerok = 0;		// Inicializar pedido de trigger
 367:uc_libc_dev/motors/servus.c **** 	} else
 368:uc_libc_dev/motors/servus.c **** 		us04.FCont++;
 369:uc_libc_dev/motors/servus.c **** 	#endif //#if (US04_USES == pdON)
 370:uc_libc_dev/motors/servus.c **** }
 182              		.loc 1 370 0
 183 004c F8BD     		pop	{r3, r4, r5, r6, r7, pc}
 184              	.LVL6:
 185              	.L48:
 186 004e 00BF     		.align	2
 187              	.L47:
 188 0050 00000000 		.word	.LANCHOR0
 189              		.cfi_endproc
 190              	.LFE6:
 192              		.section	.text.servus_Init,"ax",%progbits
 193              		.align	1
 194              		.global	servus_Init
 195              		.thumb
 196              		.thumb_func
 198              	servus_Init:
 199              	.LFB0:
  61:uc_libc_dev/motors/servus.c **** 	uint x;	for (x=0;x<SERVO_N_MODULE;x++) {
 200              		.loc 1 61 0
 201              		.cfi_startproc
 202              		@ args = 0, pretend = 0, frame = 0
 203              		@ frame_needed = 0, uses_anonymous_args = 0
 204              	.LVL7:
 205 0000 F8B5     		push	{r3, r4, r5, r6, r7, lr}
 206              	.LCFI1:
 207              		.cfi_def_cfa_offset 24
 208              		.cfi_offset 3, -24
 209              		.cfi_offset 4, -20
 210              		.cfi_offset 5, -16
 211              		.cfi_offset 6, -12
 212              		.cfi_offset 7, -8
 213              		.cfi_offset 14, -4
  62:uc_libc_dev/motors/servus.c **** 		servoCtrl[x].interval_count = 0;
 214              		.loc 1 62 0
 215 0002 0023     		movs	r3, #0
  63:uc_libc_dev/motors/servus.c **** 		servoCtrl[x].pos_count= 0;
 216              		.loc 1 63 0
 217 0004 1D46     		mov	r5, r3
  65:uc_libc_dev/motors/servus.c **** 		servoCtrl[x].enable = en;
 218              		.loc 1 65 0
 219 0006 40F2DC56 		movw	r6, #1500
  63:uc_libc_dev/motors/servus.c **** 		servoCtrl[x].pos_count= 0;
 220              		.loc 1 63 0
 221 000a 274C     		ldr	r4, .L52
 222 000c 1427     		movs	r7, #20
  66:uc_libc_dev/motors/servus.c **** 	}
 223              		.loc 1 66 0
 224 000e 00F00100 		and	r0, r0, #1
 225              	.LVL8:
 226              	.L50:
  63:uc_libc_dev/motors/servus.c **** 		servoCtrl[x].pos_count= 0;
 227              		.loc 1 63 0 discriminator 3
 228 0012 07FB03F1 		mul	r1, r7, r3
 229 0016 6218     		adds	r2, r4, r1
 230 0018 1561     		str	r5, [r2, #16]
  64:uc_libc_dev/motors/servus.c **** 		servoCtrl[x].pos= 1500;
 231              		.loc 1 64 0 discriminator 3
 232 001a D560     		str	r5, [r2, #12]
  65:uc_libc_dev/motors/servus.c **** 		servoCtrl[x].enable = en;
 233              		.loc 1 65 0 discriminator 3
 234 001c 5660     		str	r6, [r2, #4]
  66:uc_libc_dev/motors/servus.c **** 	}
 235              		.loc 1 66 0 discriminator 3
 236 001e 625C     		ldrb	r2, [r4, r1]	@ zero_extendqisi2
  62:uc_libc_dev/motors/servus.c **** 		servoCtrl[x].interval_count = 0;
 237              		.loc 1 62 0 discriminator 3
 238 0020 0133     		adds	r3, r3, #1
 239              	.LVL9:
  66:uc_libc_dev/motors/servus.c **** 	}
 240              		.loc 1 66 0 discriminator 3
 241 0022 60F30002 		bfi	r2, r0, #0, #1
  62:uc_libc_dev/motors/servus.c **** 		servoCtrl[x].interval_count = 0;
 242              		.loc 1 62 0 discriminator 3
 243 0026 072B     		cmp	r3, #7
  66:uc_libc_dev/motors/servus.c **** 	}
 244              		.loc 1 66 0 discriminator 3
 245 0028 6254     		strb	r2, [r4, r1]
  62:uc_libc_dev/motors/servus.c **** 		servoCtrl[x].interval_count = 0;
 246              		.loc 1 62 0 discriminator 3
 247 002a F2D1     		bne	.L50
 105:uc_libc_dev/motors/servus.c **** 	#if (SERVO_N_MODULE > 1)
 248              		.loc 1 105 0
 249 002c 1F4B     		ldr	r3, .L52+4
 250              	.LVL10:
 251 002e 4FF48061 		mov	r1, #1024
 252 0032 1A68     		ldr	r2, [r3]
 253 0034 42F48062 		orr	r2, r2, #1024
 254 0038 1A60     		str	r2, [r3]
 255 003a 1D4A     		ldr	r2, .L52+8
 256 003c 1160     		str	r1, [r2]
 107:uc_libc_dev/motors/servus.c **** 	#endif
 257              		.loc 1 107 0
 258 003e 1968     		ldr	r1, [r3]
 259 0040 41F40071 		orr	r1, r1, #512
 260 0044 1960     		str	r1, [r3]
 261 0046 4FF40071 		mov	r1, #512
 262 004a 1160     		str	r1, [r2]
 110:uc_libc_dev/motors/servus.c **** 	#endif
 263              		.loc 1 110 0
 264 004c 1968     		ldr	r1, [r3]
 265 004e 41F48071 		orr	r1, r1, #256
 266 0052 1960     		str	r1, [r3]
 267 0054 4FF48071 		mov	r1, #256
 268 0058 1160     		str	r1, [r2]
 113:uc_libc_dev/motors/servus.c **** 	#endif
 269              		.loc 1 113 0
 270 005a 1968     		ldr	r1, [r3]
 271 005c 41F01001 		orr	r1, r1, #16
 272 0060 1960     		str	r1, [r3]
 273 0062 1021     		movs	r1, #16
 274 0064 1160     		str	r1, [r2]
 116:uc_libc_dev/motors/servus.c **** 	#endif
 275              		.loc 1 116 0
 276 0066 1968     		ldr	r1, [r3]
 277 0068 41F00201 		orr	r1, r1, #2
 278 006c 1960     		str	r1, [r3]
 279 006e 0221     		movs	r1, #2
 280 0070 1160     		str	r1, [r2]
 119:uc_libc_dev/motors/servus.c **** 	#endif
 281              		.loc 1 119 0
 282 0072 1968     		ldr	r1, [r3]
 283 0074 41F00101 		orr	r1, r1, #1
 284 0078 1960     		str	r1, [r3]
 285 007a 0121     		movs	r1, #1
 286 007c 1160     		str	r1, [r2]
 122:uc_libc_dev/motors/servus.c **** 	#endif
 287              		.loc 1 122 0
 288 007e 1868     		ldr	r0, [r3]
 289 0080 40F48040 		orr	r0, r0, #16384
 290 0084 1860     		str	r0, [r3]
 291 0086 4FF48043 		mov	r3, #16384
 292 008a 1360     		str	r3, [r2]
 125:uc_libc_dev/motors/servus.c **** 	servus_SetIntHandler(servus_CallSytem);
 293              		.loc 1 125 0
 294 008c 0846     		mov	r0, r1
 295 008e 0322     		movs	r2, #3
 296 0090 FFF7FEFF 		bl	timer1_Init
 297              	.LVL11:
 298 0094 FA20     		movs	r0, #250
 299 0096 FFF7FEFF 		bl	timer1_SetMatch0
 300              	.LVL12:
 127:uc_libc_dev/motors/servus.c **** 
 301              		.loc 1 127 0
 302 009a BDE8F840 		pop	{r3, r4, r5, r6, r7, lr}
 303              	.LCFI2:
 304              		.cfi_restore 14
 305              		.cfi_restore 7
 306              		.cfi_restore 6
 307              		.cfi_restore 5
 308              		.cfi_restore 4
 309              		.cfi_restore 3
 310              		.cfi_def_cfa_offset 0
 126:uc_libc_dev/motors/servus.c **** }
 311              		.loc 1 126 0
 312 009e 0549     		ldr	r1, .L52+12
 313 00a0 0020     		movs	r0, #0
 314 00a2 FFF7FEBF 		b	timer1_SetIntHandler
 315              	.LVL13:
 316              	.L53:
 317 00a6 00BF     		.align	2
 318              	.L52:
 319 00a8 00000000 		.word	.LANCHOR0
 320 00ac 20C00920 		.word	537509920
 321 00b0 3CC00920 		.word	537509948
 322 00b4 00000000 		.word	servus_CallSytem
 323              		.cfi_endproc
 324              	.LFE0:
 326              		.section	.text.servus_Finish,"ax",%progbits
 327              		.align	1
 328              		.global	servus_Finish
 329              		.thumb
 330              		.thumb_func
 332              	servus_Finish:
 333              	.LFB1:
 129:uc_libc_dev/motors/servus.c **** 	servus_TimeStop();		// Desligo o timer para não gerar int para servus_CallSytem
 334              		.loc 1 129 0
 335              		.cfi_startproc
 336              		@ args = 0, pretend = 0, frame = 0
 337              		@ frame_needed = 0, uses_anonymous_args = 0
 338              		@ link register save eliminated.
 130:uc_libc_dev/motors/servus.c **** }
 339              		.loc 1 130 0
 340 0000 0020     		movs	r0, #0
 341 0002 FFF7FEBF 		b	timer1_Set
 342              	.LVL14:
 343              		.cfi_endproc
 344              	.LFE1:
 346              		.section	.text.servus_SetPos,"ax",%progbits
 347              		.align	1
 348              		.global	servus_SetPos
 349              		.thumb
 350              		.thumb_func
 352              	servus_SetPos:
 353              	.LFB2:
 202:uc_libc_dev/motors/servus.c **** 	if ( (servo==0) || (servo>SERVO_N_MODULE) ) return errDEVICE_NOT_FOUND;
 354              		.loc 1 202 0
 355              		.cfi_startproc
 356              		@ args = 0, pretend = 0, frame = 0
 357              		@ frame_needed = 0, uses_anonymous_args = 0
 358              		@ link register save eliminated.
 359              	.LVL15:
 203:uc_libc_dev/motors/servus.c **** 	if ( (us<100) || (us>3000)) return errDEVICE_VALUE_INVALID;
 360              		.loc 1 203 0
 361 0000 0138     		subs	r0, r0, #1
 362              	.LVL16:
 363 0002 0628     		cmp	r0, #6
 364 0004 0CD8     		bhi	.L57
 204:uc_libc_dev/motors/servus.c **** 	servoCtrl[servo-1].pos_load = us;
 365              		.loc 1 204 0
 366 0006 40F65433 		movw	r3, #2900
 367 000a A1F16402 		sub	r2, r1, #100
 368 000e 9A42     		cmp	r2, r3
 369 0010 08D8     		bhi	.L58
 205:uc_libc_dev/motors/servus.c **** 
 370              		.loc 1 205 0
 371 0012 064B     		ldr	r3, .L59
 372 0014 1422     		movs	r2, #20
 373 0016 02FB0030 		mla	r0, r2, r0, r3
 374              	.LVL17:
 375 001a 8160     		str	r1, [r0, #8]
 207:uc_libc_dev/motors/servus.c **** }
 376              		.loc 1 207 0
 377 001c 0120     		movs	r0, #1
 378 001e 7047     		bx	lr
 379              	.L57:
 203:uc_libc_dev/motors/servus.c **** 	if ( (us<100) || (us>3000)) return errDEVICE_VALUE_INVALID;
 380              		.loc 1 203 0
 381 0020 0348     		ldr	r0, .L59+4
 382 0022 7047     		bx	lr
 383              	.L58:
 204:uc_libc_dev/motors/servus.c **** 	servoCtrl[servo-1].pos_load = us;
 384              		.loc 1 204 0
 385 0024 6FF49770 		mvn	r0, #302
 208:uc_libc_dev/motors/servus.c **** 
 386              		.loc 1 208 0
 387 0028 7047     		bx	lr
 388              	.L60:
 389 002a 00BF     		.align	2
 390              	.L59:
 391 002c 00000000 		.word	.LANCHOR0
 392 0030 D4FEFFFF 		.word	-300
 393              		.cfi_endproc
 394              	.LFE2:
 396              		.section	.text.servus_Enable,"ax",%progbits
 397              		.align	1
 398              		.global	servus_Enable
 399              		.thumb
 400              		.thumb_func
 402              	servus_Enable:
 403              	.LFB3:
 214:uc_libc_dev/motors/servus.c **** 	if ( (servo == 0) || (servo > SERVO_N_MODULE) ) return errDEVICE_NOT_FOUND;
 404              		.loc 1 214 0
 405              		.cfi_startproc
 406              		@ args = 0, pretend = 0, frame = 0
 407              		@ frame_needed = 0, uses_anonymous_args = 0
 408              		@ link register save eliminated.
 409              	.LVL18:
 215:uc_libc_dev/motors/servus.c **** 	servoCtrl[servo-1].enable = (en == 0)?0:1;
 410              		.loc 1 215 0
 411 0000 0138     		subs	r0, r0, #1
 412              	.LVL19:
 413 0002 0628     		cmp	r0, #6
 414 0004 0BD8     		bhi	.L63
 216:uc_libc_dev/motors/servus.c **** 	return pdPASS;
 415              		.loc 1 216 0
 416 0006 1423     		movs	r3, #20
 417 0008 5843     		muls	r0, r3, r0
 418              	.LVL20:
 419 000a 064A     		ldr	r2, .L64
 420 000c 0031     		adds	r1, r1, #0
 421 000e 135C     		ldrb	r3, [r2, r0]	@ zero_extendqisi2
 422 0010 18BF     		it	ne
 423 0012 0121     		movne	r1, #1
 424              	.LVL21:
 425 0014 61F30003 		bfi	r3, r1, #0, #1
 426 0018 1354     		strb	r3, [r2, r0]
 217:uc_libc_dev/motors/servus.c **** }
 427              		.loc 1 217 0
 428 001a 0120     		movs	r0, #1
 429 001c 7047     		bx	lr
 430              	.LVL22:
 431              	.L63:
 215:uc_libc_dev/motors/servus.c **** 	servoCtrl[servo-1].enable = (en == 0)?0:1;
 432              		.loc 1 215 0
 433 001e 0248     		ldr	r0, .L64+4
 218:uc_libc_dev/motors/servus.c **** 
 434              		.loc 1 218 0
 435 0020 7047     		bx	lr
 436              	.L65:
 437 0022 00BF     		.align	2
 438              	.L64:
 439 0024 00000000 		.word	.LANCHOR0
 440 0028 D4FEFFFF 		.word	-300
 441              		.cfi_endproc
 442              	.LFE3:
 444              		.section	.text.servus_Enabled,"ax",%progbits
 445              		.align	1
 446              		.global	servus_Enabled
 447              		.thumb
 448              		.thumb_func
 450              	servus_Enabled:
 451              	.LFB4:
 224:uc_libc_dev/motors/servus.c **** 	if ( (servo == 0) || (servo > SERVO_N_MODULE) ) return errDEVICE_NOT_FOUND;
 452              		.loc 1 224 0
 453              		.cfi_startproc
 454              		@ args = 0, pretend = 0, frame = 0
 455              		@ frame_needed = 0, uses_anonymous_args = 0
 456              		@ link register save eliminated.
 457              	.LVL23:
 225:uc_libc_dev/motors/servus.c **** 	if (servoCtrl[servo-1].enable) return pdON; else return pdOFF;
 458              		.loc 1 225 0
 459 0000 0138     		subs	r0, r0, #1
 460              	.LVL24:
 461 0002 0628     		cmp	r0, #6
 226:uc_libc_dev/motors/servus.c **** }
 462              		.loc 1 226 0
 463 0004 9FBF     		itttt	ls
 464 0006 1423     		movls	r3, #20
 465 0008 5843     		mulls	r0, r3, r0
 466              	.LVL25:
 467 000a 034B     		ldrls	r3, .L69
 468 000c 1858     		ldrls	r0, [r3, r0]
 469 000e 94BF     		ite	ls
 470 0010 00F00100 		andls	r0, r0, #1
 225:uc_libc_dev/motors/servus.c **** 	if (servoCtrl[servo-1].enable) return pdON; else return pdOFF;
 471              		.loc 1 225 0
 472 0014 0148     		ldrhi	r0, .L69+4
 227:uc_libc_dev/motors/servus.c **** 
 473              		.loc 1 227 0
 474 0016 7047     		bx	lr
 475              	.L70:
 476              		.align	2
 477              	.L69:
 478 0018 00000000 		.word	.LANCHOR0
 479 001c D4FEFFFF 		.word	-300
 480              		.cfi_endproc
 481              	.LFE4:
 483              		.section	.bss.servoCtrl,"aw",%nobits
 484              		.align	2
 485              		.set	.LANCHOR0,. + 0
 488              	servoCtrl:
 489 0000 00000000 		.space	140
 489      00000000 
 489      00000000 
 489      00000000 
 489      00000000 
 490              		.text
 491              	.Letext0:
 492              		.file 2 "uc_libc_dev/_libdef/uc_libdefs.h"
 493              		.file 3 "uc_libc_dev/_arch/arm_lpc/timer/timer1.h"
DEFINED SYMBOLS
                            *ABS*:00000000 servus.c
D:\_temp\_windows\ccAsDHBx.s:20     .text.servus_SetPin:00000000 $t
D:\_temp\_windows\ccAsDHBx.s:24     .text.servus_SetPin:00000000 servus_SetPin
D:\_temp\_windows\ccAsDHBx.s:98     .text.servus_SetPin:00000058 $d
D:\_temp\_windows\ccAsDHBx.s:105    .text.servus_CallSytem:00000000 $t
D:\_temp\_windows\ccAsDHBx.s:109    .text.servus_CallSytem:00000000 servus_CallSytem
D:\_temp\_windows\ccAsDHBx.s:188    .text.servus_CallSytem:00000050 $d
D:\_temp\_windows\ccAsDHBx.s:193    .text.servus_Init:00000000 $t
D:\_temp\_windows\ccAsDHBx.s:198    .text.servus_Init:00000000 servus_Init
D:\_temp\_windows\ccAsDHBx.s:319    .text.servus_Init:000000a8 $d
D:\_temp\_windows\ccAsDHBx.s:327    .text.servus_Finish:00000000 $t
D:\_temp\_windows\ccAsDHBx.s:332    .text.servus_Finish:00000000 servus_Finish
D:\_temp\_windows\ccAsDHBx.s:347    .text.servus_SetPos:00000000 $t
D:\_temp\_windows\ccAsDHBx.s:352    .text.servus_SetPos:00000000 servus_SetPos
D:\_temp\_windows\ccAsDHBx.s:391    .text.servus_SetPos:0000002c $d
D:\_temp\_windows\ccAsDHBx.s:397    .text.servus_Enable:00000000 $t
D:\_temp\_windows\ccAsDHBx.s:402    .text.servus_Enable:00000000 servus_Enable
D:\_temp\_windows\ccAsDHBx.s:439    .text.servus_Enable:00000024 $d
D:\_temp\_windows\ccAsDHBx.s:445    .text.servus_Enabled:00000000 $t
D:\_temp\_windows\ccAsDHBx.s:450    .text.servus_Enabled:00000000 servus_Enabled
D:\_temp\_windows\ccAsDHBx.s:478    .text.servus_Enabled:00000018 $d
D:\_temp\_windows\ccAsDHBx.s:484    .bss.servoCtrl:00000000 $d
D:\_temp\_windows\ccAsDHBx.s:488    .bss.servoCtrl:00000000 servoCtrl
                     .debug_frame:00000010 $d

UNDEFINED SYMBOLS
timer1_Init
timer1_SetMatch0
timer1_SetIntHandler
timer1_Set
